<%@ page contentType="text/html;charset=UTF-8" trimDirectiveWhitespaces="true"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<c:set var="extLibs" value="validate,fileupload"/>
<sys:header title="互助金补助申请表管理 - ${mihMutualFund.isNewRecord ? '新增' : '编辑'}互助金补助申请表" extLibs="${extLibs}" htmlClass="scroll"/>
<link href="${ctxStatic}/common/css/form.css" rel="stylesheet" type="text/css">
<div class="portlet box ${boxStyleColor} autoHeight">
	<div class="portlet-body form">
		<form:form id="inputForm" modelAttribute="mihMutualFund" action="${ctx}/mih/mihMutualFund/save" method="post" class="form-horizontal">



			<div class="tool">
				<c:if test="${mihMutualFund.approveStatus=='0'||mihMutualFund.approveStatus==null||mihMutualFund.approveStatus=='3'||mihMutualFund.approveStatus=='5'||mihMutualFund.approveStatus=='7'}">
					<input id="btnSubmit" type="button" value="保存" class="tool1">
					<input id="btnSubmit1" type="button" value="提交" class="tool1">
				</c:if>

				<input id="btnCancel" type="button" value="关闭" class="tool1" onclick="closeCurrentTabPage('${param.parentTabPageId}')">
			</div>


			<div class="biaodan_bg">
				<div class="biaodan">
					<table width="100%" border="0" class="tb2">
						<tr>
							<td colspan="6" align="center"  ><strong style="font-size:24px; font-weight:normal;">${fns:getConfig('university')}职工补充医疗保险互助金补助申请表</strong></td>
						</tr>
					</table>
					<table width="100%" border="0" class="tb4">

						<form:hidden path="id"/>
						<form:hidden path="approveStatus"/>
						<form:hidden path="office.officeCode"/>
						<form:hidden path="officeName"/>

						<tr>
							<td  width="100" class="text-center" bgcolor="#f5f5f5">姓名</td>
							<td width="120">
								<form:hidden path="memberCode"/>
								<form:input path="memberName" htmlEscape="false" maxlength="64" class="form-control required"/>
							</td>
							<td  width="100" class="text-center" bgcolor="#f5f5f5">性别</td>
							<td width="120">
								<form:select path="sex" multiple="false" class="form-control required input-sm"  >
									<form:options items="${fns:getDictList('sex')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
								</form:select>
							</td>
							<td  width="100" class="text-center" bgcolor="#f5f5f5">年龄</td>
							<td width="120">
								<form:input path="age" htmlEscape="false" maxlength="64" class="form-control required"/>
							</td>
						</tr>
						<tr>

							<td  width="100" class="text-center" bgcolor="#f5f5f5">身份证号</td>
							<td colspan="5" width="120">
								<form:input path="idNo" htmlEscape="false" maxlength="64" class="form-control required"/>
							</td>


						</tr>
						<tr>
							<td  width="100" class="text-center" bgcolor="#f5f5f5">住址</td>
							<td  colspan="3" width="120">
								<form:input path="address" htmlEscape="false" maxlength="64" class="form-control required"/>
							</td>
							<td  width="100" class="text-center" bgcolor="#f5f5f5">电话</td>
							<td width="120">
								<form:input path="phone" htmlEscape="false" maxlength="64" class="form-control required"/>

							</td>
						</tr>

						<tr>

							<td width="100" class="text-center" bgcolor="#f5f5f5">报销种类</td>
							<td colspan="1" width="120">
								<form:select path="kindCode" multiple="false" class="form-control required input-sm"  >
									<form:options items="${fns:getDictList('apply_kind')}" itemLabel="name" itemValue="value" htmlEscape="false"/>
								</form:select>
								<form:input path="kindName" htmlEscape="false" maxlength="64" class="form-control hidden"/>
							</td>
							<td width="100" class="text-center" bgcolor="#f5f5f5">所患疾病病种</td>
							<td colspan="3" width="120">
								<form:input path="disease" htmlEscape="false" maxlength="64" class="form-control required"/>
							</td>
						</tr>
						<tr>
							<td  width="100" class="text-center" bgcolor="#f5f5f5">有效单据张数</td>
							<td width="120">
								<form:input path="billNum" htmlEscape="false" maxlength="64" class="form-control required"/>

							</td>
							<td  colspan="2" width="100" class="text-center" bgcolor="#f5f5f5">有效单据总金额</td>
							<td colspan="2" width="120">
								<form:input path="amount" htmlEscape="false" maxlength="64" class="form-control required aaa"/>
							</td>



						</tr>


						<tr>
							<td  width="100" class="text-center" bgcolor="#f5f5f5">社保已报金额</td>
							<td width="120">
								<form:input path="reportedAmount" htmlEscape="false" maxlength="64" class="form-control required aaa"/>

							</td>
							<td  colspan="1" width="100" class="text-center" bgcolor="#f5f5f5">自费金额</td>
							<td colspan="1" width="120">
								<form:input path="selfAmount" htmlEscape="false" maxlength="64" class="form-control required" readonly="true"/>
							</td>
							<td  colspan="1" width="100" class="text-center" bgcolor="#f5f5f5">报销金额</td>
							<td colspan="1" width="120">
								<form:input path="applyAmount" htmlEscape="false" maxlength="64" class="form-control" placeholder="系统自动计算" readonly="true"/>
							</td>


						</tr>


						<tr>
							<td class="text-center" bgcolor="#f5f5f5">详情说明</td>
							<td colspan="5">
								<form:textarea path="details" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm"/>
							</td>
						</tr>
						<c:if test="${mihMutualFund.approveStatus>1}">
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">部门工会意见</td>
								<td colspan="5">
									<form:textarea path="officeApproveMemo" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm" disabled="true"/>
								</td>
							</tr>


						</c:if>

						<c:if test="${mihMutualFund.approveStatus>3}">
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">互助金管理委员审查小组意见</td>
								<td colspan="5">
									<form:textarea path="reviewApproveMemo" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm" disabled="true"/>
								</td>
							</tr>


						</c:if>
						<c:if test="${mihMutualFund.approveStatus>5}">
							<tr>
								<td class="text-center" bgcolor="#f5f5f5">互助金管理委员会审批意见</td>
								<td colspan="7">
									<form:textarea path="committeeApproveMemo" htmlEscape="false" rows="8" maxlength="200" class="form-control required input-sm" disabled="true"/>
								</td>
							</tr>

						</c:if>
						<tr>
							<td class="text-center" bgcolor="#f5f5f5">票据粘帖处：</td>
							<td colspan="5">
								<form:hidden path="billNames"/>
								<form:hidden path="billPaths"/>

								<sys:fileupload id="billPaths"  returnPath="true" filePathInputId="billPaths" fileNameInputId="billNames"  bizCategory="billPath" bizKey="${mihMutualFund.id}" />
							</td>
						</tr>




					</table>
				</div>
			</div>


		</form:form>
	</div>
</div>
<sys:footer extLibs="${extLibs}"/>
<script type="text/javascript">
	$("#inputForm").validate({
		submitHandler: function(form){
			$("#kindName").val($("#kindCode option:selected").text());
			ajaxSubmitForm($(form), function(data){
				showMessage(data.message);
				if(data.result == Global.TRUE){
					closeCurrentTabPage('${param.parentTabPageId}', function(contents, contentWindow){
						contentWindow.page();
					});
				}
			}, "json");
		}
	});


	$('#btnSubmit').click(function(){
		$("#approveStatus").val("0");
		$("#inputForm").submit();
	});
	$('#btnSubmit1').click(function(){
		$("#approveStatus").val("1");
		$("#inputForm").submit();
	});




	$(".aaa").blur(function(){

		var amount =$("#amount").val();
		var reportedAmount =$("#reportedAmount").val();

		if (amount!=''&&amount!=null&&reportedAmount!=''&&reportedAmount!=null){


			$("#selfAmount").val(Number(amount)-Number(reportedAmount));
		}


	});
</script>